import 'dart:math';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(body: buildProgressBarListView(context)),
      // routes:{
      //   "new_page":(context) => NewRoute(),
      // } ,
    );
  }

  buildProgressBarListView(BuildContext context) {
    print("buildProgressBarListView()");
    return Center(
        child: Container(
      height: 200.0,
      child: new ListView(
        scrollDirection: Axis.horizontal,
        children: [
          new Container(
            width: 120,
            color: Colors.lime,
          ),
          new Container(
            width: 120,
            color: Colors.pinkAccent,
          ),
          new Container(
            width: 120,
            color: Colors.purpleAccent,
          ),
          new Container(
            width: 120,
            color: Colors.deepPurple,
          ),
        ],
      ),
    ));

    //   Center(
    //   child: Container(
    //     height: 200.0,
    //     child: ListView(
    //       scrollDirection: Axis.horizontal,
    //       children: <Widget>[
    //         Image.network("https://www.qq745.com/uploads/allimg/170416/17-1F4161H131Y9-lp.png"),
    //         Image.network("http://ww1.sinaimg.cn/thumb180/006am4TEgw1f3x8tq1gqrj31480qo7js.jpg"),
    //         Image.network("https://www.qq745.com/uploads/allimg/150907/2221003F2-0-lp.jpg"),
    //         Image.network("http://ww2.sinaimg.cn/thumb180/0066fqovgw1f75tu2nxhfj30ku0dvjtq.jpg"),
    //         Image.network("http://p5.sinaimg.cn/2782984404/180/14791407463112"),
    //       ],
    //     ),
    //   ),
    // );

    // ListView.builder(
    //   padding: EdgeInsets.fromLTRB(3, 3, 3, 3),
    //   scrollDirection: Axis.horizontal,
    //   itemCount: 20,
    //   itemBuilder: (BuildContext context, int index) {
    //     Random random = Random();
    //     Color tempcol = Color.fromRGBO(
    //       random.nextInt(255),
    //       random.nextInt(255),
    //       random.nextInt(255),
    //       1,
    //     );
    //     return Container(width: 200, height: 100, color: tempcol);
    //   });
  }
}
